OpenPlant Isometrics Manager Help

Manipulate Data Pre and Post Isometric Generation

Isometrics Manager provides the ability for administrators/users with programming and scripting knowledge to customize isometric data at selected points during the isometric process. External programs can pick up and manipulate data and write it back to the isometric. The three intervention points currently allowed are:
  • Before the intermediate file is read.
  • After the intermediate file is read but before any logic (spools, part numbers, reports) is applied.
  • After the reports are generated.
Note: Please note that these customizations are for users/administrators with sufficient programming knowledge as any errors could disrupt the isometric generation process.

Hook.ini File

A Hook.ini file resides in the Config directory for each isometric style. See the sample path for the IFC style shown below:

C:\...\WorkSpaces\OpenPlantExample\WorkSets\Imperial\Standards\OpenPlant\Isometrics\styles\IFC\config

This file contains three sections (seen below), each with the ability to run a .bat file where the user can define the data modifications to make.

; -----------------------------------------------------------------------------

; OPIM configuration file for hooks
;
; OPIM allows the user to customize isometric data at selected points in the 
; isometric generation process. External programs can pick up data, process
; and/or manipulate it and write back the data to the isometric
;
; Examples:
;   - Manipulate the intermediate file before it's read. 
;   - Change/augment component data with data from external databases
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; The Export section lists the project configuration variables
; exported for the external processes
; The following are automatically output:
;    L00FILE   - set to the full path of the L00 file
;    BASENAME  - set to the base name of the dgn
; -----------------------------------------------------------------------------
[Export]
  ;export = IE_L00  IE_REPORTDIR  IE_CONF
  ;export = IE_PROJNAME
; -----------------------------------------------------------------------------
; Called before the intermediate file is interpreted
; Basic use is to augment/change the intermediate file 
; -----------------------------------------------------------------------------
[0100]
  ;Run = cmd / K
  ;run = cmd /K $(IE_CONF)hook100.bat
  ;RUN = $(IE_CONF)hook.bat
; -----------------------------------------------------------------------------
; Called before a DGN is generated (Inherently operates on sheet data)
; -----------------------------------------------------------------------------
[0200]
  ;RUN = cmd / K
  ;RUN_IO = cmd /K $(IE_CONF)/hook200.bat
; -----------------------------------------------------------------------------
; Called after the reports are generated.
; -----------------------------------------------------------------------------
[0300]
  ;Run = cmd / K

The Flow Chart below gives a basic idea of the isometric generation sequence and how the Hook.ini file is used.

Isometric Generation Stage 1: Hook 0100 is called before the intermediate file is read. The only use of this hook is to alter the intermediate file before it is interpreted by OpenPlant Isometrics Manager.

Note: Please note that in this stage no DGN is being produced, it’s a pure memory based exercise.

Isometric Generation Stage 2: Hook 0200 is called after the DBQUERY's are done. When using the RUN_IO option a neutral file is written out and read back in when the hook program terminates, Basically all drawing attributes and component properties are replaced.

The numbering logic is currently performed at the sheet level.

Note: Stage 2 is performed for every sheet.

Hook 0300 is mainly used to perform a post processing function such as archive results or create accumulated material lists.

Basic Example

The following is a basic example of how you can manipulate data outputted to an isometric. The settings defined below will modify the description of a long radius elbow in the isometric from 'LONG RADIUS' to 'LR'.

Pre-Processing

Pre processing is when the user would modify the intermediate file before it is processed.

In the Hook.ini file, the following is added to the [0100] section:

; -----------------------------------------------------------------------------
; Called before the intermediate file is interpreted
; Basic use is to augment/change the intermediate file 
; -----------------------------------------------------------------------------
[0100]
  RUN = $(IE_CONF)hook_0100.bat

Create a new file, hook_0100.bat, in the ...\Config directory with the following content:

powershell -Command "(Get-content -Path '%L00FILE%') -replace 'LONG RADIUS' , 'LR' | Out-File '%L00FILE%' -encoding 'UTF8'"

Now, when processing an isometric, a console window will display showing that LONG RADIUS was replaced LR in the intermediate file and in the isometric.

Post-Processing

During this stage, the current data is written to a neutral file. The user has the option to augment this file using external programs or script files to manipulate the date. The results are read back into OpenPlant Isometrics Manager and the component properties/drawing attributes are replaced with the augmented results.

In the basic example below, the '90 Degree' text will be replaced with '90'.

In the Hook.ini file add the following the [0200] section:

; -----------------------------------------------------------------------------
; Called before a DGN is generated (Inherently operates on sheet data)
; -----------------------------------------------------------------------------
[0200]
  RUN_IO = $(IE_CONF)hook_0200.bat

Add the following to the [EXPORT] section:

[Export]
  export = IE_REPORTDIR

Next, create a hook_0200.bat file in the ...\Config directory with the following content:

set dsnf=%IE_REPORTDIR%%BASENAME%.neutral
powershell -Command "(Get-content -Path '%dsnf%') -replace '90 Degree' , '90' | Out-File '%dsnf%' -encoding 'UTF8'"

When generating the isometric a console will display showing that 90 Degree was replaced with 90 in the isometric, but not in the intermediate file.

The resulting text would display as follows:

Without any Hooks

With Hook [0100] Processed

With Hooks [0100] and [0200] Processed